package com.define.commons.query.service;

import com.gitee.fastmybatis.core.query.Query;

import java.util.List;
import java.util.Map;

/**
 * 根据泛型提供基础CRUD的 Service
 * 对 FastMybatis 提供的接口进行整理去掉冲突的接口
 *
 * @Author xiewenlong
 * @Date 2018/10/31 12:49
 */
public interface FastMybatisBaseService<T, I> {
    /**
     * 该方法与通用mapper冲突，已废除
     */
    // public int delete(T t);
    public int deleteById(I i);

    public int deleteByQuery(Query query);

    public int save(T t);

    public int saveIgnoreNull(T t);

    public int saveBatch(List<T> list);

    public int saveMulti(List<T> list);

    public int saveMultiSet(List<T> list);

    public T getById(I i);

    public T getByQuery(Query query);

    public T getByColumn(String s, Object o);

    public long getCount(Query query);

    public List<T> listByColumn(String s, Object o);

    public List<T> list(Query query);

    public List<Map<String, Object>> listMap(List<String> list, Query query);

    public int update(T t);

    public int updateIgnoreNull(T t);

    public int updateByQuery(Object o, Query query);
}
